import time
import unittest

from selenium import webdriver
from selenium.webdriver.common.by import By

from Page.Page import Page
from Page.Page1 import Page1
from Page.Page2 import Page2


class Test_case(unittest.TestCase):

    def setUp(self)->None:

        self.driver=webdriver.Edge()
        self.driver.maximize_window()
        self.driver.implicitly_wait(5)

    def tearDown(self) ->None:
        time.sleep(10)
        self.driver.quit()

    def test_jiuxian_01(self):
        po=Page(self.driver)
        po.jiuxian_luoji()
        print(po.dyuserlogin)
        self.assertEqual('帐号登录', po.dyuserlogin)
        print(po.dy1)
        assert po.dy1 == 'jxw786936337'
        # print(po.dy2)
        # assert po.dy2 =='酒仙自营汾酒官方旗舰店'
        #下面是在page页面类没有写业务逻辑，而在case类写业务逻辑的方法
        # po.open_url('https://www.jiuxian.com/')
        # po.loginbtn()
        # po.user_login()
        # po.pass_login()
        # time.sleep(10)
        # po.loginbtn()
        # po.login_sure()

    def test_jiuxian_02(self):
        po=Page1(self.driver)
        po.jiuxian_luoji2()
    def test_jiuxian_03(self):
        po=Page2(self.driver)
        po.jiuxian_luoji3()

if __name__ == '__main__':
    unittest.main()

